#! /usr/bin/env python
# -*- coding:utf8 -*-
# vim: ts=8 tw=4 sts=4 et
import wx
import os

class TestFileDropTarget(wx.FileDropTarget):
    def OnDropFiles(self, x, y, filePaths):
        for filePath in filePaths:
            print filePath

class MainPanel(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
        label = wx.StaticText(self, -1, u"파일을 올려주세요")

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(label, 0, wx.ALL, 5)
        self.SetSizer(sizer)

    
class MainFrame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, -1, title)
        self.CentreOnScreen(wx.BOTH)
        panel = MainPanel(self)
        panel.Layout()
        panel.SetDropTarget(TestFileDropTarget())

class MainApp(wx.App):
    def OnInit(self):
        frame = MainFrame(None, "Main Frame")
        frame.Show()
        self.SetTopWindow(frame)
        return True

    def OnExit(self):
        pass

if __name__ == "__main__":
    MainApp(redirect=False).MainLoop()
